Skip to content

Use proven bounds when restoring spilled operands - #669

Open
jogibear9988 wants to merge 1 commit into
dadhi:masterfrom
jogibear9988:fix/bounded-spill-metadata-20261114
Open

jogibear9988 wants to merge 1 commit into
dadhi:masterfrom
jogibear9988:fix/bounded-spill-metadata-20261114

Conversation

@jogibear9988

Copy link
Copy Markdown
Contributor

Use GetSurePresentRef when restoring index operands and array dimensions whose slots were populated by the same bounded loop. This avoids repeating checked SmallList access.

Tests exercise inline and overflow metadata, array ranks through 12, and all four spilled index operands.

Validation

Full Release solution build and Standard/LightExpression native runners pass for net8.0, net10.0 and net472. net8.0: 688 TestX and 1744 legacy cases; net10.0: 688 TestX and 1745 legacy cases; net472: 669 TestX and 1610 legacy cases.

Measurements

FEC on master da14580f10fd19ae2361a8e91cfad4b2dfec182a → this change a25f3a4da33e6728890328b393e8bfeb627c8b0d. Windows ARM64; .NET 8.0.28 and 10.0.9; SDK 10.0.301.

Trees, API conversions and invocation adapters are built before measurement. Compilation includes delegate creation; runtime measures the compiled delegate through the same adapter. Both sides are FEC: “System trees” names the expression API, not the System compiler.

Two opposite-load-order process rounds; seven alternating paired samples per round; medians of 14 samples, 100 ms calibration target. Verified task-local runtimes; tiered compilation disabled; each process pinned to one logical CPU. Allocations use GC.GetAllocatedBytesForCurrentThread. Slower observations are retained. Timing variation, including unchanged IL controls, prevents a blanket speedup or no-regression claim.

Runtime / API Workload Compile μs, master → patch Compile B/op Runtime ns, master → patch Runtime B/op
net10.0 / LightExpression bounds_spill_eight 7.210 → 5.763 4312.0 68.374 → 75.150 96.0
net10.0 / LightExpression bounds_spill_twelve 9.052 → 8.457 6392.0 88.316 → 87.180 128.0
net10.0 / LightExpression index_spill_four 4.873 → 4.942 2648.0 6.527 → 5.258 24.0
net10.0 / LightExpression scalar_add 2.038 → 2.651 872.0 2.971 → 3.260 0.0
net10.0 / System trees bounds_spill_eight 7.617 → 8.559 4312.0 81.816 → 71.554 96.0
net10.0 / System trees bounds_spill_twelve 10.781 → 10.312 6392.0 119.172 → 104.611 128.0
net10.0 / System trees index_spill_four 6.302 → 5.859 2648.1 7.140 → 5.720 24.0
net10.0 / System trees scalar_add 2.418 → 3.186 872.0 2.805 → 2.739 0.0
net8.0 / LightExpression bounds_spill_eight 27.880 → 28.130 4312.1 208.762 → 265.143 96.0
net8.0 / LightExpression bounds_spill_twelve 36.744 → 44.497 6392.1 326.316 → 244.605 128.0
net8.0 / LightExpression index_spill_four 15.177 → 16.789 2648.0 8.545 → 11.270 24.0
net8.0 / LightExpression scalar_add 3.671 → 3.866 872.0 3.757 → 3.788 0.0
net8.0 / System trees bounds_spill_eight 22.477 → 23.074 4312.1 142.591 → 167.225 96.0
net8.0 / System trees bounds_spill_twelve 31.854 → 27.935 6392.1 283.713 → 314.921 128.0
net8.0 / System trees index_spill_four 15.882 → 18.692 2648.2 9.260 → 6.457 24.0
net8.0 / System trees scalar_add 5.242 → 5.125 872.0 3.248 → 3.290 0.0

Shared-workload emitted IL is unchanged.

Allocation changes: none beyond measurement rounding in these shared workloads.

Use GetSurePresentRef when restoring index operands and array dimensions whose slots were populated by the same bounded loop. This avoids repeating checked SmallList access.

Tests exercise inline and overflow metadata, array ranks through 12, and all four spilled index operands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant